{include file="public/header"}
<body>
<fieldset class="layui-elem-field">
    <legend>向上级提交的订单列表</legend>
    <div class="layui-field-box">
        <span id="load" class="layui-btn layui-btn-normal">全部订单</span>
        <span id="not_delivery" class="layui-btn layui-btn-normal">未发放订单</span>
        <table class="layui-table" lay-even>
            <thead>
            <tr>
                <th>订单Id</th>
                <th>上级代理商姓名</th>
                <th>电话</th>
                <th>订单交易个数</th>
                <th>创建日期</th>
                <th>交易状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody  id="searchContent">
            {volist name="list" id="vo"}
            <tr>
                <td>{$vo['id']}</td>
                <td>{$vo['name']}</td>
                <td>{$vo['mobile']}</td>
                <td>{$vo['num']}</td>
                <td>{$vo['create_time']}</td>
                <td>
                    {if condition="$vo['is_delivery'] == 0"}
                    <span style="border-radius: 2px;background-color: #FF5722;padding:5px 10px;color: #ffffff">未发放</span>
                    {else /}
                    <span style="border-radius: 2px;background-color: #5FB878;padding:5px 10px;color: #ffffff">已发放</span>
                    {/if}
                </td>
                <td>
                    <span onclick="detail({$vo['id']})" class="layui-btn layui-btn-normal">查看详情</span>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

        <div>{$list->render()}</div>
    </div>
</fieldset>


{include file="public/footer"}
<script>
    layui.use(['layer'], function() {});

    function detail(id) {
        layer.open({
            type: 2,
            area: ['90%', '90%'],
            title: '订单详情',
            maxmin: true,
            content: '/agent/order/detail/id/'+id
        });
    }

    $('#load').click(function () {
        window.location.href = "{:url('index')}";
    });
    $('#not_delivery').click(function () {
        window.location.href = "{:url('index', array('delivery' => 'no'))}";
    });
</script>
</body>
</html>